//核心部分..
import Vue from 'vue'
import App from './App.vue'
import store from 'store/index.js'
import router from 'router/index.js'
import htmlToPdf from '@/components/utils/htmlToPdf' // html转pdf
import '@/icons'

// 导入全局样式表
import './assets/CSS/global.css'

// 导入全局字体样式表
import './assets/Alibaba-PuHuiTi/Alibaba-PuHuiTi.css'

//UI部分..
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

//6. 引入阿里云OSS
import aliyunOSS from 'ali-oss'

// 导入富文本编辑组件
import VueQuillEditor from "vue-word-editor";
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme

Vue.use(VueQuillEditor, /* { default global options } */)

//自定义按钮级权限..
import { buttonPermission } from 'src/permisson/buttonPermission.js'
import axios from 'axios'
import VueAxios from "vue-axios";
//设置post请求头类型
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';
axios.defaults.baseURL = "https://api.asset.havefunner.com/asserts/"
// axios.defaults.baseURL = "http://rap2api.taobao.org/app/mock/297978/"
// axios.defaults.baseURL = "http://172.22.29.59:8080/asserts/"
// axios.defaults.baseURL = "http://172.22.29.59:8080/asserts/"
// axios.defaults.baseURL = "http://219.216.65.8:8080/asserts/"

import Avue from '@smallwei/avue';
import '@smallwei/avue/lib/index.css';

Vue.use(Avue);

Vue.use(VueAxios, axios)-

Vue.use(htmlToPdf)


//全局变量..
Vue.prototype.buttonPermission = buttonPermission
Vue.config.productionTip = false
Vue.use(ElementUI);


new Vue({
	store,
	router,
	render: h => h(App),
}).$mount('#app')


// const app = createApp(App)
//vue3添加原型的方法
// app.config.globalProperties.$axios = axios
// app.config.globalProperties.$qs = qs
// Vue.prototype.$moment = moment;

// app.use(ElementPlus, { locale }).use(store).use(router).mount('#app')

// axios.interceptors.request.use(

// 	config => {
// 		// 判断是否存在token，如果存在的话，则每个http header都加上token
// 		let token = localStorage.getItem('token')
// 		if (!config.headers.hasOwnProperty('Authorization1') && token) {
// 			config.headers.Authorization1 = token;
// 		}
// 		return config;
// 	},
// 	error => {
// 		return Promise.reject(error);
// 	});
// axios.defaults.contentType = 'application/json'
// // axios.defaults.contentType = 'application/x-www-form-urlencoded'
// axios.defaults.withCredentials = true